package com.wclass.config;

import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Controller;

import java.util.Date;

/**
 * 自动填充
 **/
@Controller
public class MyMetaObjectHandler extends MetaObjectHandler {



    @Override
    public void insertFill(MetaObject metaObject) {
        Object crtTime = metaObject.getValue("crtTime");
        if (null == crtTime) {
            metaObject.setValue("crtTime", new Date());
        }
    }


    @Override
    public void updateFill(MetaObject metaObject) {


    }
}
